package io.renren.modules.miniapp.controller;

import io.renren.common.utils.PageUtils;
import io.renren.common.utils.R;
import io.renren.modules.communityService.dto.DbOneClickAlarmDTO;
import io.renren.modules.communityService.service.DbOneClickAlarmService;
import io.renren.modules.miniapp.dto.MiniAppDbOneClickAlarmListDTO;
import io.renren.modules.miniapp.dto.MiniAppDbOneClickAlarmSaveDTO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;


/**
 * 一键报警
 *
 * @author chenweilong
 * @email 1433471850@qq.com
 * @date 2021-03-21 13:45:49
 */
@RestController
@RequestMapping("miniapp/dboneclickalarm")
@Api(value = "小程序一键报警",tags = "小程序一键报警")
public class MiniAppDbOneClickAlarmController {
    @Autowired
    private DbOneClickAlarmService dbOneClickAlarmService;



    /**
     * 列表
     */
    @GetMapping("/list")
    @ApiOperation(value = "报警记录",notes = "报警记录")
    public R list(MiniAppDbOneClickAlarmListDTO dbOneClickAlarm){
        PageUtils page = dbOneClickAlarmService.queryPage(dbOneClickAlarm);
        return R.data(page);
    }


    /**
     * 保存
     */
    @PostMapping("/save")
    @ApiOperation(value = "一键报警",notes = "一键报警")
    public R save(@RequestBody MiniAppDbOneClickAlarmSaveDTO dto){
		dbOneClickAlarmService.save(dto);
        return R.ok();
    }


}
